﻿<div>
    <div class="title-bold-18 green">
        {{governanceForCompany.companyName}}
    </div><br />
    <div class="title-bold-16">
        Company profile
    </div>
    <div class="table" ng-show="governanceForCompany.hasProfile">
        <div class="table-row">
            <div class="table-head width_370" style="width: 526px;">Publication date</div>
            <div class="table-head width_250">Actions</div>

        </div>
        <div class="table-row ng-scope">
            <div class="table-col width_370" style="width: 526px;">{{governanceForCompany.companyProfile.publicationDate | date: 'MMM d, y'}}</div>
            <div class="table-col width_250">
                <button class="button-lynks" ng-click="governanceForCompany.editProfile()">Edit</button>
                <button class="button-lynks" ng-click="governanceForCompany.deleteProfile()">Delete</button>
                <button class="button-lynks"
                        ng-click="governanceForCompany.downloadGovernancePDF(governanceForCompany.companyProfile.fileId, governanceForCompany.companyProfile.fileName)"
                        ng-disabled="!governanceForCompany.downloadGovernanceFileEnabled(governanceForCompany.companyProfile.fileId, governanceForCompany.companyProfile.fileName)"
                        style="margin-right: 0;">
                    Download PDF
                </button>
            </div>
        </div>

    </div><br /><br />
    <div class="table-row ng-scope" ng-show="!governanceForCompany.hasProfile">
        <div class="table-col width_370" style="width: 526px;">The company does not have a published profile</div>
        <div class="table-col width_250" style="text-align: right;">
            <button class="btn-green" ng-click="governanceForCompany.addProfile()">Add Profile</button>
        </div>
    </div>

    <div class="title-bold-16">
        Alerts
    </div>
    <div class="table" ng-show="governanceForCompany.companyProfile.alerts.length > 0">
        <div class="table-row">
            <div class="table-head width_130">Publication date</div>
            <div class="table-head width_200">Title</div>
            <div class="table-head width_190">Created By</div>
            <div class="table-head width_250">Actions</div>

        </div>
        <div class="table-row ng-scope" ng-repeat="item in governanceForCompany.companyProfile.alerts">
            <div class="table-col width_130">{{item.publicationDate | date: 'MMM d, y'}}</div>
            <div class="table-col width_200">{{item.title}}</div>
            <div class="table-col width_190">{{item.createdBy}}</div>
            <div class="table-col width_250">
                <button class="button-lynks" ng-click="governanceForCompany.editAlert(item)">Edit</button>
                <button class="button-lynks" ng-click="governanceForCompany.deleteAlert(item)">Delete</button>
                <button class="button-lynks"
                        ng-click="governanceForCompany.downloadGovernancePDF(item.fileId, item.fileName)"
                        ng-disabled="!governanceForCompany.downloadGovernanceFileEnabled(item.fileId, item.fileName)"
                        style="margin-right: 0;">
                    Download PDF
                </button>
            </div>
        </div>
    </div><br />
    <div ng-show="!governanceForCompany.hasProfile">Please add the profile before creating alerts.</div>
    <button class="btn-green" ng-disabled="!governanceForCompany.hasProfile" ng-click="governanceForCompany.addAlert()">Add New Alert</button>
</div>
